feat(tables): improve view and filter controls - #6725
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Columns and Sort menus now use the same dropdown pattern— The filter builder drops Apply/Clear: dropdowns, conjunction toggles, and row removal apply immediately; text values commit on Enter or blur through a local draft. Autosave only runs when the normalized predicate signature changes, with deferred commits when an operator change leaves a rule incomplete (e.g. valueless → equals until a value is committed). Opening the panel or refreshing columns does not write by itself. Table shell skips Reviewed by Cursor Bugbot for commit 1fe415c. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR completes the table-view control improvements and fixes the previously reported unsolicited OR-filter rewrite.
Confidence Score: 5/5The PR appears safe to merge. The previously reported unsolicited OR-filter rewrite no longer remains: opening the builder performs no write, supported OR boundaries survive conversion, and persistence occurs only after a completed user edit.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-filter/table-filter.tsx | Moves commits into completed user-event handlers and preserves supported OR boundaries without writing when the panel opens. |
| apps/sim/lib/table/query-builder/converters.ts | Extends predicate conversion to preserve valueless operators and the flat builder’s supported AND/OR grouping. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx | Persists filter gestures and default-view changes while avoiding identical-filter remounts. |
| apps/sim/hooks/queries/tables.ts | Prevents stale view-update responses from replacing or demoting a newer cached default. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/views-menu/views-menu.tsx | Adds editable default-view pins while retaining menu focus and open-state behavior. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/columns-menu/columns-menu.tsx | Migrates column toggles to the shared dropdown-menu presentation and keeps the menu open across selections. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Stored table-view filter] --> B[Convert predicate to builder rules]
B --> C[Render without autosave]
C --> D{User completes an edit?}
D -- No --> E[Preserve stored filter]
D -- Yes --> F[Convert complete rules to predicate]
F --> G[Update active table filter]
G --> H[Persist active view configuration]
Reviews (4): Last reviewed commit: "fix(tables): preserve filters during rul..." | Re-trigger Greptile
e4f0403 to
a262d4f
Compare
|
@cursor review |
…onses Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
a262d4f to
5aa0911
Compare
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1fe415c. Configure here.
Summary
This second PR builds on #6724 and completes the table-view control changes. Users can choose which saved view is a table's default via a pin in the Views menu. The Columns menu now matches the Sort menu's typography and icon sizing and stays open across toggles. The filter builder has no Apply or Clear buttons: dropdown and row gestures apply immediately, while typed text commits on Enter or blur.
Filter commits now happen directly in completed user-event handlers, not in an after-render effect. Opening the panel, rerendering it, or refreshing column data does not write anything by itself. The save baseline still seeds from the builder's own reading of the stored filter, so a stored tree the flat builder renders differently is only normalized after the user actually edits a rule.
Autosave hardening:
isNullandisNotNullconditions and mixed AND/OR filters round-trip through the builder without being silently dropped or flattened until the user changes them.Type of Change
Testing
isNullshapes, stale promotion responses leaving the default untouched, and the disabled default pin staying inert.bun run lintandbun run lint:checkbun run check:audits(29 repository policy audits)bun run --cwd apps/sim type-checkbun run apps/sim/scripts/check-block-registry.ts feat/better-table-views-uxChecklist
Screenshots/Videos
Not included. DOM interaction tests cover the changed menus and filter-commit behavior.
Post-Deploy Monitoring & Validation